import { createRouter, createWebHistory } from 'vue-router'
import LayoutView from '@/views/layout/LayoutView.vue'
import HomeView from '@/views/home/HomeView.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'LayoutView',
      component: LayoutView,
      redirect:'/home',
      children:[
        {
          path:'/home',
          name:'HomeView',
          component:HomeView
        },
        {
          path:'/cart',
          name:'CartView',
          component:() => import('@/views/cart/CartView.vue')
        },
        {
          path:'/order',
          name:'OrderView',
          component:()=> import('@/views/order/OrderView.vue')
        },
        {
          path:'/my',
          name:'MyView',
          component:()=>import('@/views/my/MyView.vue')
        }
      ]
    },
    {
      name:'shop',
      path:'/shop',
      component:()=>import('@/views/shop/ShopView.vue')
    },
    {
      name:'orderComfirm',
      path:'/orderConfirm',
      component:()=>import('@/views/order/OrderConfirmView.vue')
    },
    {
      path: '/address',
      name: 'AddressView',
      component: () => import('@/views/my/AddressView.vue'),
    }
  ]
})

export default router
